import request from "@/utils/request";

// 查询企业列表
export function listCompany(query) {
  return request({
    url: '/company/list',
    method: 'get',
    params: query
  })
}

// 查询企业所在监管下来选择
export function orgTreeList() {
  return request({
    url: '/org/treeList',
    method: 'get'
  })
}

export function addCompany(company){
  return request({
    url: '/company/saveCompany',
    method: 'post',
    data: company
  })
}

export function getCompany(companyId){
  return request({
    url: '/company/'+companyId,
    method: 'get'
  })
}

export function updateCompany(company){
  return request({
    url: '/company/updateCompany',
    method: 'post',
    data: company
  })
}

export function deleteCompany(companyId){
  return request({
    url: '/company/' + companyId,
    method: 'delete',
  })
}

export function changeCompanyStatus(companyId,status){
  const data = {
    companyId,status
  }
  return request({
    url: '/company/changeStatus',
    method: 'post',
    data: data
  })

}
